package cn.snow.iot.module.warning.dal.mysql.rule;


import cn.snow.iot.module.warning.controller.admin.home.vo.RuleUseCountVO;
import cn.snow.iot.module.warning.controller.admin.rule.vo.WarningRuleVO;
import cn.snow.iot.module.warning.dal.dataobject.config.WarningDO;
import cn.snow.iot.module.warning.dal.dataobject.rule.WarningRuleDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface WarningRuleMapper extends BaseMapper<WarningRuleDO> {
    IPage<WarningRuleDO> selectProductPage(IPage<WarningDO> page, @Param("entity") WarningRuleVO ruleVO);

    @Select("select count(*) from warning_rule where deleted = 0")
    Integer getRuleCount();

    List<RuleUseCountVO> getRuleUseCount();
}
